package zhh.tangbao.commodity.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import zhh.tangbao.commodity.vo.CommodityMachineStockVo;
import zhh.tangbao.system.entity.DaoEntity;

import java.util.Date;
import java.util.List;

/**
 * 2023/2/26
 * @author 粥灰灰
 * @version 1.0
 * 售卖机器信息
 */

@TableName(value = "commodity_machine_entity")
@Data
public class CommodityMachineEntity extends DaoEntity {

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /** 机器的代称 */
    private String machineName;

    /** 激活状态 */
    private Integer activationStatus;

    /** 激活码 */
    private String activationCode;

    /**激活时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date activationTime;

    /** 机器位置 */
    private String machinePosition;

    /** 机器照片 */
    private String machineImg;

    /** 总商品数量上限 */
    private Integer totalStock;

    /** 机器工作状态，0：机器关闭，1：正常运行，2：机器维护中 */
    private Integer runningState;


    @TableField(exist = false)
    private List<CommodityMachineStockVo> stocks;

    @TableField(exist = false)
    private Integer queueSize;
}
